<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <meta name="keywords" content="pdfh5.js,pdf.js,gjTool,gjtool.cn,www.gjtool.cn,gjTool.js,移动端展示预览打开pdf,手机端展示预览打开pd" />
    <meta name="description" content="pdf.js移动端展示预览打开pdf-pdfh5.js" />
    <title>pdf.js移动端展示预览打开pdf-pdfh5.js</title>
    <link rel="stylesheet" href="css/style.css" />
    <link href="//www.gjtool.cn/download/pdfh5.png" type="image/x-icon" rel="shortcut icon" />
    <style>
        html,
        body {
            width: 100%;
            height: 100%;
        }

        .docs-header-content {
            max-width: 388px;
            float: left;
            position: relative;
            padding: 50px 10px;
            text-align: center;
            -webkit-animation-name: fadeintext;
            -moz-animation-name: fadeintext;
            animation-name: fadeintext;
            -webkit-animation-duration: 2s;
            -moz-animation-duration: 2s;
            animation-duration: 2s;
            background: #fff;
        }

        .docs-subtitle {
            max-width: 750px;
            margin: 0 auto 20px;
            font-size: 28px;
            font-weight: 300;
            line-height: 38px;
            color: #d64c28;
            margin-bottom: 30px;
            font-size: 41px;
            line-height: 60px;
        }

        .github-btn {
            overflow: hidden;
            border: 0;
        }

        .phone {
            margin: 10px auto;
            position: relative;
            background: #111;
            border-radius: 55px;
            box-shadow: 0px 0px 0px 2px #aaa;
            width: 270px;
            height: 358px;
            padding: 105px 25px;
            -webkit-box-sizing: content-box;
            box-sizing: content-box;
            float: right;
            transform: translateX(-8%);
        }

        .phone iframe {
            width: 270px;
            height: 100%;
            display: block;
            width: 100%;
            margin-top: 15px;
        }

        .phone:before {
            content: '';
            width: 60px;
            height: 10px;
            border-radius: 10px;
            position: absolute;
            left: 50%;
            margin-left: -30px;
            background: #333;
            top: 50px;
        }

        .phone:after {
            content: '';
            position: absolute;
            width: 60px;
            height: 60px;
            left: 50%;
            margin-left: -30px;
            bottom: 20px;
            border-radius: 100%;
            box-sizing: border-box;
            border: 5px solid #333;
        }

        .phone .statusbar {
            position: absolute;
            width: 270px;
            height: 15px;
            background: url('');
            left: 50%;
            margin-left: -135px;
            top: 104px;
            -webkit-background-size: 100% auto;
            background-size: 100% auto;
        }

        :before,
        :after {
            -webkit-box-sizing: border-box;
            -moz-box-sizing: border-box;
            box-sizing: border-box;
        }

        .phone-link {
            position: absolute;
            width: 100%;
            top: 100%;
            left: 0;
            text-align: center;
            margin-top: 25px;
            margin-bottom: 25px;
        }

        a,
        a:focus,
        a:active,
        a:visited {
            color: #018efb;
            text-decoration: underline;
        }

        ol {
            width: 90%;
            margin-left: 40px;
            list-style: decimal;
            text-align: left;
        }

        ol li {
            margin: 10px 0;
        }
    </style>
</head>

<body>
    <div style="max-width:1024px;margin:0 auto;">
        <div class="docs-header-content" style="transform:none;-webkit-transform:none;">
            <p class="docs-subtitle">pdfh5.js - 移动端预览PDF插件，基于pdf.js和jQuery</p>
            <a href="//github.com/gjTool/pdfh5"
                style="display:block;margin-bottom:30px;">
                <div id="code"></div>
            </a>
            <iframe class="github-btn"
                src="//ghbtns.com/github-btn.html?user=gjtool&amp;repo=pdfh5&amp;type=watch&amp;count=true" width="100"
                height="20">
            </iframe>
            <iframe class="github-btn"
                src="//ghbtns.com/github-btn.html?user=gjtool&amp;repo=pdfh5&amp;type=fork&amp;count=true" width="100"
                height="20">
            </iframe>
            <p style="text-align: left;margin-top: 20px;">本插件所需文件如下：</p>
            <ol>
                <li><a target="_blank" download="cmaps.zip"
                        href="//www.gjtool.cn/download/cmaps.zip">cmaps文件夹-解决字体不全问题（下载压缩包解压） 下载大小：969kb</a></li>
                <li><a target="_blank" download="pdf.js" href="//www.gjtool.cn/pdfh5/js/pdf.js">pdf.js 下载大小：317kb</a></li>
                <li><a target="_blank" download="pdf.worker.js" href="//www.gjtool.cn/pdfh5/js/pdf.worker.js">pdf.worker.js
                        下载大小：749kb</a></li>
                <li><a target="_blank" download="js"
                        href="//www.gjtool.cn/pdfh5/js/jquery-1.11.3.min.js">jquery-1.11.3.min.js 下载大小：94kb</a></li>
                <li><a target="_blank" download="pdfh5.js" href="//www.gjtool.cn/pdfh5/js/pdfh5.js">pdfh5.js 下载大小：22kb</a>
                </li>
                <li><a target="_blank" download="pdfh5.css" href="//www.gjtool.cn/pdfh5/css/pdfh5.css">pdfh5.css 下载大小：9kb</a>
                </li>
            </ol>

        </div>
        <p style="text-align: left;margin-top: 20px;padding-left: 10px;">pdfh5支持在线预览，修改地址栏file=后的地址就行，如果不填写，就在实例化的时候传入pdf地址：</p>
        <a target="_blank"
            href="//www.gjtool.cn/pdfh5/pdf.html?file=//www.gjtool.cn/pdfh5/test.pdf" style="padding-left: 10px;">http://www.gjtool.cn/pdfh5/pdf.html?file=//www.gjtool.cn/pdfh5/test.pdf</a>
        <p style="text-align: left;margin-top: 20px;padding-left: 10px;">
            默认优先获取浏览器地址栏？file=后面的地址，如果地址栏没有，再拿配置项的pdfurl或者data来渲染pdf。pdfh5实例初始化：</p>
<pre style="text-align: left;margin-top: 20px;background: #111;color:aqua">
    var pdfh5 = new Pdfh5('.pdfjs', {
        pdfurl: 'default.pdf'
    });
</pre>
        <div class="phone">
            <iframe src="pdf.html" frameborder="0" scrolling="no"></iframe>
            <div class="statusbar"></div>
            <a href="pdf.html" target="_blank"
                style="display:block;width:60px;height:60px;position: absolute;bottom:20PX;left:50%;margin-left: -30px;z-index:100;"></a>
            <p class="phone-link">
                <a target="_blank" href="pdf.html">Open it in a new page</a>
            </p>
            <p style="position: absolute;bottom: -96px;left: 0;color: #777;font-size: 14px;
            text-indent: 70px;">鄂ICP备19002193号-1</p>
        </div>

    </div>
    <script src="js/jquery-1.11.3.min.js"></script>
    <script src="js/jquery.qrcode.min.js"></script>
    <script>
        $('#code').qrcode(location.href);
        var _hmt = _hmt || [];
        (function () {
            var hm = document.createElement("script");
            hm.src = "https://hm.baidu.com/hm.js?d924028c274d650b6f12d391ec251143";
            var s = document.getElementsByTagName("script")[0];
            s.parentNode.insertBefore(hm, s);
        })();
        (function () {
            var bp = document.createElement('script');
            var curProtocol = window.location.protocol.split(':')[0];
            if (curProtocol === 'https') {
                bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';
            }
            else {
                bp.src = 'http://push.zhanzhang.baidu.com/push.js';
            }
            var s = document.getElementsByTagName("script")[0];
            s.parentNode.insertBefore(bp, s);
        })();
    </script>
</body>

</html>